﻿using System.Windows;

namespace RobotGerchik.Views.Dialogs
{
    /// <summary>
    /// Логика взаимодействия для DialogOkCancel.xaml
    /// </summary>
    public partial class DialogOkCancel : Window
    {
        public MessageBoxResult Result;

        #region Constructors

        public DialogOkCancel()
        {
            InitializeComponent();

            this.ShowDialog();
        }

        public DialogOkCancel(object message, string title)
        {
            InitializeComponent();
            this.Title = title;
            this.messageBox.Text = message.ToString();

            this.ShowDialog();
        }

        #endregion

        private void buttonOK_Click(object sender, RoutedEventArgs e)
        {
            Result = MessageBoxResult.OK;
            Close();
        }

        private void buttonCancel_Click(object sender, RoutedEventArgs e)
        {
            Result = MessageBoxResult.Cancel;
            Close();
        }
    }
}
